home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / what's new / technical documentation / macintosh technotes and q&as / technotes / tn / tn1160.old < prev    next >
Encoding:
Text File  |  1999-04-26  |  65.8 KB  |  1,716 lines

  1. <HTML><!-- Edited by Karl Schlosser -->
  2. <HEAD>
  3.    <TITLE>TN 1160: What's New With ColorSync 2.6</TITLE>
  4.    <LINK REL="stylesheet" HREF="/style.css" TYPE="text/css">
  5.     <meta name="keywords" content="have creator list relevant keywords here">
  6.     <meta name="Description" content="have creator write a brief description here.">
  7. </HEAD>
  8.  
  9. <BODY bgcolor="#ffffff">
  10. <A HREF="#top"></a>
  11. <!--top banner-->
  12. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="600">
  13.             <TR>
  14.                 <TD>
  15.                 <!-- start of header -->
  16.                 <!--#include file="header" -->
  17.                 <!-- -->
  18.                 <!-- end of header -->
  19.                 <!-- -->
  20.                 </TD>
  21.             </tr>
  22. </table>
  23. <table width="550" cellpadding="0" cellspacing="0" border="0">
  24.     <tr>
  25.         <td>
  26.         
  27.         <H1>Technote 1160
  28.          </H1>
  29.         
  30.          <H2>What's New With ColorSync 2.6
  31.          </H2>
  32.          
  33.          <B>By Scott Kuechle</B><BR>
  34.          
  35.          <B>Apple Worldwide Developer Technical Support</B>
  36.          <BR>       
  37.          
  38.       </TD></TR>
  39. </TABLE>
  40. <hr size="1" noshade color="#000000" width="550" align="left">
  41.  
  42. <TABLE BORDER=0 CELLPADDING=10 width=550>
  43.    <TR>
  44.       <TD VALIGN=top bgcolor="cccc99" WIDTH="40%">
  45.          <H4>CONTENTS</H4>
  46.          
  47.          <P id=p1>
  48.          <A HREF="#Requirements">System Requirements</A><BR><BR>
  49.          
  50.          <A HREF="#Checking">Checking for ColorSync 2.6</A><BR><BR>
  51.          
  52.          <A HREF="#Gettinginfo">ColorSync 2.6 Version Information</A><BR><BR>
  53.          
  54.          <A HREF="#NewAPIs">New ColorSync 2.6 APIs</A><BR><BR>
  55.          <A HREF="#NewWindows2">New ColorSync 2.6 for Windows APIs</A><BR><BR>
  56.          <A HREF="#Compatibility">ColorSync 2.6 for Macintosh Compatibility Issues</a><BR><BR>
  57.         <A HREF="#WinCompatibility">ColorSync 2.6 for Windows Compatibility Issues</a><BR><BR>
  58.  
  59.          <A HREF="#References">Further References</A><BR><BR>
  60.          <A HREF="#Downloads">Downloadables</A>
  61.          </p>
  62.       </TD>
  63.       <TD VALIGN=top>
  64.           <FONT SIZE="+4" COLOR="#0000AF">C</FONT>olorSync 2.6 is the latest version of Apple Computer's color management architecture for Mac OS, Windows 95/98, and Windows NT 4.0. This Technote describes in detail the changes in this new version of ColorSync. This note is primarily intended for developers who are using the ColorSync APIs.
  65.          </P>      
  66.        </TD></TR>
  67. </TABLE>
  68. <hr size="1" noshade color="#000000" width="550" align="left">
  69.  
  70. <TABLE BORDER=0 CELLPADDING=1 width=550>
  71.    <TR>
  72.       <TD>
  73.          <A NAME="Requirements"></A>
  74.          
  75.          <H2>System Requirements</H2><BR>
  76.          
  77.          <P>ColorSync 2.6 for Macintosh requires a PowerPC machine running Mac OS 8.1 or later.  ColorSync 2.6 for Windows requires an IBM-compatible PC running Windows 95/98 or Windows NT 4.0.</P>
  78.       </TD></TR>
  79. </TABLE>
  80. <BR>
  81. <p id=p1>
  82. <a href="#top">Back to top</a>
  83. </p>
  84.  
  85.  
  86. <TABLE BORDER=0 CELLPADDING=1 width=550>
  87.    <TR>
  88.       <TD>
  89.          <A NAME="Checking"></A>
  90.          
  91.          <H2>Checking for ColorSync 2.6</H2>
  92.          
  93.          <P><B>Macintosh</B><BR>
  94. <BR>
  95. To determine if the ColorSync Manager shared libraries have been loaded on a PowerPC machine, use the <CODE>Gestalt</CODE> function with the <CODE>gestaltColorMatchingAttr</CODE> selector. Test the bit field (bit 1) indicated by the <CODE>gestaltColorMatchingLibLoaded</CODE> constant in the response parameter. If the bit is set, the ColorSync Manager shared libraries are loaded. The following code snippet shows how this is done. This code snippet initializes the <CODE>ColorSyncAvailable</CODE> Boolean variable to <CODE>false</CODE>.</P>
  96.  
  97.     </td>
  98.     </tr>
  99.     </table>
  100.     
  101. <TABLE BORDER=0 CELLPADDING=1>
  102.     <TR>
  103.     <TD bgcolor="EEEEE0">
  104.                   
  105. <PRE>Boolean CheckIfColorSyncAvailableOnPPC (void)
  106. {
  107.      Boolean ColorSyncAvailable = false;
  108.      long gestaltResponse;
  109.  
  110.          if (Gestalt(gestaltColorMatchingAttr, &gestaltResponse) == noErr)
  111.          {
  112.               ColorSyncAvailable =
  113.                    gestaltResponse & (1 << gestaltColorMatchingLibLoaded);
  114.          }
  115.        
  116.          return ColorSyncAvailable;
  117. }
  118. </PRE>
  119.     </TD>
  120.     </tr>
  121. </table>
  122.  
  123. <BR>
  124. <B>Windows 95/98, Windows NT 4.0</B><BR>
  125. <BR>
  126. <TABLE>
  127. <TR>
  128.     <TD width=550>
  129. <P>
  130. To check for the presence of ColorSync under Windows 95/98 and Windows NT, use the new ColorSync 2.6 function <CODE>CMGetColorSyncVersion</CODE> (see the section "<A HREF="#NewAPIs">New ColorSync 2.6 APIs</A>" below for the details). ColorSync will first attempt to load the ColorSync DLLs if you call this function on a Windows system. If the ColorSync DLLs can't be loaded, an error code will be returned, indicating ColorSync is not present.
  131. </P>
  132.  
  133. <P>
  134. The <CODE>CMGetColorSyncVersion</CODE> function also returns the ColorSync version information. Here's a code snippet that checks for ColorSync version 2.6 on Windows:
  135. </P>
  136.         </TD>
  137.     </TR>
  138. </TABLE>
  139. <BR>
  140.             
  141. <TABLE BORDER=0 CELLPADDING=1>
  142.     <TR>
  143.     <TD bgcolor="EEEEE0">
  144.                   
  145. <PRE>
  146. #define  kColorSync26  0x00000260
  147.  
  148. CMError err;
  149. UInt32 version;
  150.  
  151. err = CMGetColorSyncVersion(&version);
  152. if (err == noErr)
  153. {
  154.     if (version >= kColorSync26)
  155.     {
  156.        /* ColorSync 2.6 or better is installed */
  157.     }
  158. }
  159. else
  160. {
  161.     /* ColorSync not present */
  162. }</PRE>
  163.         </TD>
  164.     </TR>
  165. </TABLE>
  166.  
  167.  
  168. <BR>
  169. <p id=p1>
  170. <a href="#top">Back to top</a>
  171. </p>
  172.  
  173. <BR>
  174.  
  175. <TABLE BORDER=0 CELLPADDING=1 width=550>
  176.    <TR>
  177.       <TD>
  178.          <A NAME="Gettinginfo"></A>
  179.          
  180.          <H2>Getting ColorSync 2.6 Version Information</H2>
  181.          
  182.          <P><B>Windows</B><BR>
  183. <BR>
  184. As described in the section "<A HREF="#Checking">Checking for ColorSync 2.6</A>", use the new ColorSync 2.6 function <CODE>CMGetColorSyncVersion</CODE> to get ColorSync version information on machines running Windows 95/98 & Windows NT 4.0.<BR>
  185. <BR>
  186. <B>Macintosh</B><BR>
  187. <BR>
  188. As described in the section "<A HREF="#Checking">Checking for ColorSync 2.6 - Windows</A>", use the new ColorSync 2.6 function <CODE>CMGetColorSyncVersion</CODE> to get ColorSync version information on the Macintosh.<BR>
  189. <BR>
  190. </P>
  191.       </TD></TR>
  192. </TABLE>
  193.  
  194. <BR>
  195.  
  196. <TABLE BORDER=0 CELLPADDING=1 width=550>
  197.     <TR>
  198.     <TD bgcolor="eeeee0">
  199.                   <P><B>Important Note:</B><BR>
  200.                   
  201. On Macintosh systems with ColorSync 2.6 installed, the <CODE>CMGetColorSyncVersion</CODE> function returns the value <CODE>0x00026000</CODE> in the version field. However, on a Windows 
  202. system with ColorSync 2.6 installed, the same <CODE>CMGetColorSyncVersion</CODE> function returns the value <CODE>0x00000260</CODE>, which is consistent with <CODE>Gestalt</CODE> return values. Future versions of ColorSync 2.6 on the Macintosh will correct this problem and return values which are consistent with <CODE>Gestalt</CODE>.<BR>
  203.  <BR>
  204. Alternately, you can use the <CODE>Gestalt</CODE> function with the <CODE>gestaltColorMatchingVersion</CODE> selector to get ColorSync version information on the Macintosh.<BR>
  205. <BR>
  206. You can modify and use the following sample code to test for version 2.6 of the ColorSync Manager. This function initializes the Boolean variable <CODE>ColorSyncAvailable</CODE> to <CODE>false</CODE> and sets it to <CODE>true</CODE> if version 2.6 or later of the ColorSync Manager is installed.
  207.     </TD></TR>
  208. </TABLE>
  209.          
  210. <BR>
  211. <TABLE BORDER=0 CELLPADDING=1>
  212.     <TR>
  213.     <TD bgcolor="EEEEE0">
  214.                   
  215. <PRE>#define  kColorSync26  0x00000260
  216.  
  217. Boolean CheckForColorSyncMacVersion26(void)
  218. {
  219.     Boolean ColorSyncAvailable = false;
  220.     long version;
  221.  
  222.         if (Gestalt(gestaltColorMatchingVersion, &version) == noErr)
  223.         { 
  224.             if (version >= kColorSync26)
  225.             {
  226.                 ColorSyncAvailable = true;
  227.             }
  228.         }
  229.  
  230.     return ColorSyncAvailable;
  231. }</PRE>
  232. </TD>
  233. </tr>
  234. </table>
  235.  
  236. <BR>
  237. <p id=p1>
  238. <a href="#top">Back to top</a>
  239. </p>
  240.  
  241. <TABLE BORDER=0 CELLPADDING=1 width=550>
  242.    <TR>
  243.       <TD>
  244.          <A NAME="NewAPIs"></A>
  245.          
  246.          <H2>New ColorSync 2.6 APIs</H2>
  247.          
  248.          <P>The following new APIs were added to ColorSync 2.6:</P>
  249.  
  250. <TABLE BORDER=0 CELLPADDING=1>
  251.                <TR>
  252.                   <TD bgcolor="EEEEE0">
  253.                   
  254. <PRE>
  255. CMError CMGetProfileDescriptions (CMProfileRef          prof,
  256.                                   char                 *aName,
  257.                                   UInt32               *aCount,
  258.                                   Str255                mName,
  259.                                   ScriptCode           *mCode,
  260.                                   UniChar              *uName,
  261.                                   UniCharCount         *uCount);
  262. </PRE>
  263.                                   
  264.       </TD></TR>
  265. </TABLE>
  266. <BR>
  267. <B>Field Descriptions</B><BR>
  268. <TABLE width=550 border="1">
  269. <TR>
  270.     <TD valign=top>prof</TD><TD valign=top>A reference to the profile from which to obtain the desc tag info.</TD>
  271. </TR>
  272. <TR>
  273.     <TD valign=top>aName</TD><TD valign=top>A pointer to a field which is to receive the profile name as a 7-bit Roman ASCII string.</TD>
  274. </TR>
  275. <TR>
  276.     <TD valign=top>aCount</TD><TD valign=top>A pointer to a field which is to receive a count of the number of characters returned in the aName field above.</TD>
  277. </TR>
  278. <TR>
  279.     <TD valign=top>mName</TD><TD valign=top>A pointer to a field which is to receive the localized profile name string in Mac script-code format.</TD>
  280. </TR>
  281. <TR>
  282.     <TD valign=top>mCode</TD><TD valign=top>A pointer to a field which is to receive the script code corresponding to the name string returned in the mName parameter above.</TD>
  283. </TR>
  284. <TR>
  285.     <TD valign=top>uName</TD><TD valign=top>A pointer to a field which is to receive the Unicode localized profile name string.</TD>
  286. </TR>
  287. <TR>
  288.     <TD valign=top>uCount</TD><TD valign=top>A pointer to a field which is to receive a count of the number of Unicode (2-byte) characters returned in the uName field above.</TD>
  289. </TR>
  290. </TABLE>
  291.  
  292. <BR>
  293. <TABLE BORDER=0 CELLPADDING=1>
  294.     <TR>
  295.     <TD bgcolor="EEEEE0">
  296.                   
  297. <PRE>
  298. CMError CMSetProfileDescriptions (CMProfileRef           prof,
  299.                                   const char            *aName,
  300.                                   UInt32                 aCount,
  301.                                   ConstStr255Param       mName,
  302.                                   ScriptCode             mCode,
  303.                                   const UniChar         *uName,
  304.                                   UniCharCount           uCount);
  305. </PRE>
  306.     </TD>
  307.     </tr>
  308. </table>
  309. <BR>
  310. <B>Field Descriptions</B><BR>
  311. <BR>
  312. <TABLE width=550 border="1">
  313. <TR>
  314.     <TD valign=top>prof</TD>    <TD valign=top>A reference to the profile into which to set the desc tag info.</TD>
  315. </TR>
  316. <TR>
  317.     <TD valign=top>aName</TD>    <TD valign=top>A pointer to a field containing a 7-bit Roman ASCII profile name string which is to be set for the profile. This string must be null-terminated.</TD>
  318. </TR>
  319. <TR>
  320.     <TD valign=top>aCount</TD>    <TD valign=top>A count of the number of characters in the aName field above.</TD>
  321. </TR>
  322. <TR>
  323.     <TD valign=top>mName</TD>    <TD valign=top>A pointer to a field containing the localized profile name string in Mac script-code format which is to be set for the profile. This string must be null-terminated.</TD>
  324. </TR>
  325. <TR>
  326.     <TD valign=top>mCode</TD>    <TD valign=top>The script code corresponding to the name string in the mName parameter above.</TD>
  327. </TR>
  328. <TR>
  329.     <TD valign=top>uName</TD>    <TD valign=top>A pointer to a field containing the Unicode localized profile name string which is to be set for the profile. This string must be null-terminated.</TD>
  330. </TR>
  331. <TR>
  332.     <TD valign=top>uCount</TD>    <TD valign=top>A count of the number of Unicode characters in the uName field above (do not confuse this with a byte count, because each Unicode character requires two bytes).</TD>
  333. </TR>
  334. </TABLE>
  335.  
  336.  
  337. <BR>
  338. <B>DESCRIPTION</B><BR>
  339.  
  340. <P>
  341. Use these functions to get/set the description tag data for a given profile. The ICC Profile Format Specification (available at <<A HREF="http://www.color.org">http://www.color.org</A>>) includes a Description tag (<CODE>'desc'</CODE>), designed to provide more information about a profile than can be contained in a file name.  This is especially critical on file systems with 8.3 names. The tag data can consist of up to three separate pieces (strings) of information 
  342. for a profile.  These different strings are designed to allow for display in different languages or on different computer systems.  Applications typically use one of the strings to show profiles in a list or a pop-up menu.  ColorSync 2.6 includes these new APIs for accessing this information, and also checks for the validity of the <CODE>'desc'</CODE> tag according to the ICC Spec.<BR>
  343. </P>
  344.     </td>
  345.     </tr>
  346. </table>
  347. <BR>
  348. <TABLE BORDER=0 CELLPADDING=1>
  349.     <TR>
  350.     <TD bgcolor="EEEEE0">
  351.                   
  352. <PRE>
  353. CMError NCWConcatColorWorld (CMWorldRef             *cw,
  354.                              NCMConcatProfileSet    *profileSet,
  355.                              CMConcatCallBackUPP     proc,
  356.                              void                   *refCon);
  357. </PRE>
  358.     </TD>
  359.     </tr>
  360. </table>
  361.                              
  362. <BR>
  363. <B>Field Descriptions</B><BR>
  364. <BR>
  365. <TABLE width=550 border="1">
  366.  
  367. <TR>
  368.     <TD valign=top>cw</TD>    <TD valign=top>A reference to a color world that the ColorSync Manager returns if the function completes successfully. You pass this reference to other functions that use the color world for color-matching and color-checking sessions.</TD>
  369. </TR>
  370. <TR>
  371.     <TD valign=top>profileSet</TD>    <TD valign=top>An array of profiles describing the processing to be carried out. The array is in processing order source through destination.</TD>
  372. </TR>
  373. <TR>
  374.     <TD valign=top>proc</TD>    <TD valign=top>A calling-program-supplied callback function that allows your application to monitor progress or abort the operation.</TD>
  375. </TR>
  376. <TR>
  377.     <TD valign=top>refCon</TD>    <TD valign=top>A reference constant containing data specified by the calling application program.</TD>
  378. </TR>
  379. </TABLE>
  380.  
  381. <BR>
  382. <B>New structures for use with this function:</B><BR>
  383. <BR>
  384. <TABLE BORDER=0 CELLPADDING=1>
  385.     <TR>
  386.     <TD bgcolor="EEEEE0">
  387.                   
  388. <PRE>
  389. struct NCMConcatProfileSet {
  390.    OSType          cmm;              /* e.g., 'KCMS'. Uniquely IDs the CMM, or 0000 */
  391.    unsigned long   flags;            /* specify quality */
  392.    unsigned long   flagsMask;        /* which bits of flags to use to override profile. 
  393. */
  394.    unsigned long   profileCount;     /* how many ProfileSpecs in the following set */
  395.    NCWConcatProfileSpec   profileSpecs[]; /* A new structure, defined below */
  396. };
  397.  
  398. struct NCWConcatProfileSpec {
  399.    unsigned long   renderingIntent;  /* intent to use along with transformTag. */
  400.    unsigned long   transformTag;     /* one of a set of tag identifiers, defined below 
  401. */
  402.    CMProfileRef    profile;          /* the profile to extract the transform from */
  403. };
  404.  
  405. enum {
  406.   kNoTransform    = 0,               /* Not used */
  407.   kUseAtoB        = 1,               /* Use 'A2B*' tag from this profile or equivalent */
  408.   kUseBtoA        = 2,               /* Use 'B2A*' tag from this profile or equivalent */
  409.   kUseBtoB        = 3,               /* Use 'pre*' tag from this profile or equivalent */
  410.                                                                                   
  411.       /* For typical device profiles the following synonyms may be useful */
  412.  
  413.   kDeviceToPCS    = kUseAtoB,        /* Device Dependent to Device Independent */
  414.   kPCSToDevice    = kUseBtoA,        /* Device Independent to Device Dependent */
  415.   kPCSToPCS       = kUseBtoB,        /* Independent, through device's gamut */
  416.  
  417. /* This is provided for default behavior when specifying rendering intent in the NCMConcatProfileSpec 
  418. */
  419.  
  420.   kUseProfileIntent       = (long)0xFFFFFFFF      
  421.                                      /* For renderingIntent in NCMConcatProfileSpec*/
  422. };
  423.  
  424. /*
  425.   Caller-supplied progress function for NCMMConcatInit & NCMMNewLinkProfile routines
  426.  
  427. */
  428.  
  429. typedef STACK_UPP_TYPE(CMConcatCallBackProcPtr)  CMConcatCallBackUPP;
  430. typedef CALLBACK_API( Boolean, CMConcatCallBackProcPtr )
  431.                     (long progress, void *refCon);
  432.  
  433. /*
  434.   Callback Proc Creation example:
  435. */
  436.  
  437. CMConcatCallBackUPP myCallBackUpp = NewCMConcatCallBackProc(myCallBackProc); 
  438. </PRE>
  439.     </TD>
  440.     </tr>
  441. </table>
  442. <BR>
  443. <B>DESCRIPTION</B><BR>
  444. <BR>
  445. <TABLE>
  446. <TR>
  447.     <TD width=550><P>
  448. The <CODE>NCWConcatColorWorld</CODE> function defines a color world for color transformations among a series of concatenated 
  449. profiles. The caller can override the CMM that would normally be selected by ColorSync by providing a CMM identifier in the <CODE>NCMConcatProfileSet</CODE> structure, or pass 0 to accept ColorSync's CMM selection (note that this could either be the user's preferred CMM selection or the CMM called for in the profile).  The <CODE>flags</CODE> and <CODE>flagsMask</CODE> parameters are provided to allow easy customization of such attributes as quality and gamut-checking, while preserving the other settings. Each profile in the set can be customized by overriding the intent, and the selection of the transform tag. Together with other profiles, a custom-rendering environment can be set up to transform to or from device-dependent spaces with a minimum of gamut compression and/or unnecessary transformations to and from connection spaces.  This flexibility comes at the price of specific knowledge of the profile contents and how device gamuts overlap.
  450. </P>
  451.  
  452. <P>
  453. Note that for standard input and output device profiles, <CODE>A2B</CODE> and <CODE>B2A</CODE> tags represent transforms from data space to connection space and from connection space to data space, respectively.  Under these circumstances, the caller would not normally be able to use the same transform tags (e.g., <CODE>kUseAtoB</CODE>) consecutively, since a connection space would not be the same as the subsequent data space.  If the spaces aren't the same, the caller will get a <CODE>cmCantConcatenateError</CODE> error  (-178) returned. For profiles of type <CODE>cmLinkClass, cmAbstractClass, cmColorSpaceClass</CODE>, and <CODE>cmNamedColorClass</CODE>, these constants are not always meaningful, and the caller is encouraged to think in terms of the actual tags present in the profiles (e.g., <CODE>A2B0</CODE> or <CODE>B2A0</CODE>).  Under these conditions, it may well be appropriate to specify two transform tags of the same type consecutively, as long as the actual color spaces align in between tags.  If this is not the case, a <CODE>cmCantConcatenateError</CODE> error  (-178) is returned.
  454. </P>
  455.  
  456. <P>
  457. The <CODE>Callback</CODE> proc is provided as protection against the appearance of a stalled machine during lengthy color world processing.  If a CMM takes more than several seconds to process the information and create a color world, it will call the <CODE>Callback</CODE> proc, if one is provided, and pass it the <CODE>refCon</CODE> provided.  This is also true for <CODE>NCWNewLinkProfile</CODE>, described below:
  458. </P>
  459.     </TD>
  460.     </TR>
  461. </TABLE>
  462.  
  463.                      
  464. <TABLE BORDER=0 CELLPADDING=1>
  465.     <TR>
  466.     <TD bgcolor="EEEEE0">
  467.                   
  468. <PRE>CMError NCWNewLinkProfile (CMProfileRef              *prof,
  469.                            const CMProfileLocation   *targetLocation,
  470.                            NCMConcatProfileSet       *profileSet,
  471.                            CMConcatCallBackUPP        proc,
  472.                            void                      *refCon);</PRE>
  473.     </TD>
  474.     </tr>
  475. </table>
  476.  
  477. <BR>
  478. <B>Field Descriptions</B><BR>
  479. <BR>
  480. <TABLE width="500" border="1">
  481. <TR>
  482.     <TD valign=top>prof</TD>    
  483.     <TD valign=top>The returned profile reference.</TD>
  484. </TR>
  485. <TR>
  486.     <TD valign=top>targetLocation</td>  
  487.     <TD valign=top>The location of the profile, which you specify using the <CODE>CMProfileLocation</CODE> data type. Commonly a profile is disk-file based. However, the profile may be a file-based profile, a handle-based profile, or a pointer-based profile.</TD>
  488. </TR>
  489. <TR>
  490.     <TD valign=top>profileSet</TD>    
  491.     <TD valign=top>The profile set structure.</TD>
  492. </TR>
  493. <TR>
  494.     <TD valign=top>proc</TD>    
  495.     <TD valign=top>A calling-program-supplied callback function that allows your application to monitor progress or abort the operation.</TD>
  496. </TR>
  497. <TR>
  498.     <TD valign=top>refCon</TD>    
  499.     <TD valign=top>A reference constant containing data specified by the calling application program.</TD>
  500. </TR>
  501. </TABLE>
  502. <BR>
  503.  
  504. <TABLE>
  505. <TR>
  506.     <TD width=550>
  507.     <B>DESCRIPTION</B><BR>
  508. <BR>
  509. <P>
  510. The same new flexibility in creating color worlds is extended to link profiles, which are now not assumed to go from input device color space to output device color space. The returned profile is open, and should be closed when you are finished with it.
  511. </P>
  512. <BR>
  513.  
  514. <TABLE width=550 border="1">
  515. <TR>
  516.     <TD valign=top>CMError</td>    <TD valign=top><CODE>NCMSetSystemProfile</CODE> <CODE>(const CMProfileLocation *profLoc);</CODE></td>
  517.  
  518. </TR>
  519. </TABLE>
  520. <BR>
  521. <B>Field Descriptions</B><BR>
  522. <BR>
  523.  
  524. <TABLE width=550 border="1">
  525. <TR>
  526. <TD valign=top>profLoc</td>    <TD valign=top>The location of the profile, which you specify using the <CODE>CMProfileLocation</CODE> data type. Commonly a profile is disk-file based. However, the profile may be a file-based profile, a handle-based profile, or a pointer-based profile.
  527.     </td>
  528.     </TR>
  529. </TABLE>
  530.  
  531. <BR>
  532. <B>DESCRIPTION</B><BR>
  533. <BR>
  534. <P>
  535. Prior to ColorSync 2.6, the API for setting the System Profile supported only the <CODE>FSSpec</CODE> file specification type as a way of specifying a profile.  This new API is designed to address Windows file systems specifications as well.
  536. </P>
  537. <BR>
  538.             <TABLE BORDER=0 CELLPADDING=1>
  539.                <TR>
  540.                   <TD bgcolor="EEEEE0">
  541.                   
  542. <PRE>
  543. CMError NCMUnflattenProfile (CMProfileLocation *targetLocation,
  544.                              CMFlattenUPP       proc,
  545.                              void              *refCon,
  546.                              Boolean           *preferredCMMnotfound);
  547. </PRE>
  548. </TD>
  549. </tr>
  550. </table>
  551. <BR>
  552.  
  553. <B>Field Descriptions</B><BR>
  554. <BR>
  555.  
  556. <TABLE width=550 border="1">
  557. <TR>
  558. <TD valign=top>targetLocation</td>
  559. <TD valign=top>The location of the profile you wish to unflatten, which you specify using the <CODE>CMProfileLocation</CODE> data type. Commonly a profile is disk-file based. However, the profile may be a file-based 
  560. profile, a handle-based profile, or a pointer-based profile.</td>
  561. </TR>
  562. <TR>
  563. <TD valign=top>proc</td>
  564. <TD valign=top>A user-defined procedure which is called during the unflatten operation.</td>
  565. </TR>
  566. <TR>
  567. <TD valign=top>refCon</td>
  568. <TD valign=top>A reference constant containing data specified by the calling application program.</td>
  569. </TR>
  570. <TR><TD valign=top>preferredCMMnotfound</td>  
  571. <TD valign=top>A return value indicating whether or not the CMM specified in the profile was found.</td>
  572. </TR></TABLE>
  573.  
  574. <BR>
  575. <B>DESCRIPTION</B><BR>
  576. <BR>
  577. Use this function to unflatten a profile.<BR>
  578. <BR>
  579. <BR>
  580.             <TABLE BORDER=0 CELLPADDING=1>
  581.                <TR>
  582.                   <TD bgcolor="EEEEE0">
  583.                   
  584. <PRE>
  585. CMError CMIterateCMMInfo (CMMIterateUPP          proc,
  586.                           UInt32                *count,
  587.                           void                  *refCon);
  588. </PRE>
  589. </TD>
  590. </tr>
  591. </table>                          
  592. <BR>
  593. <B>Field Descriptions</B><BR>
  594. <BR>
  595.  
  596. <TABLE width=550 border = "1">
  597. <TR>
  598.     <TD valign=top>proc</TD>    <TD valign=top>A calling-program-supplied callback function that allows your application to monitor progress or abort the operation.<BR></TD>
  599. </TR>
  600. <TR>
  601.     <TD valign=topD>count</TD>    <TD valign=top>A count of the number of CMMs referenced is returned here.<BR></TD>
  602. </TR>
  603. <TR>
  604.     <TD valign=top>refCon</TD>    <TD valign=top>A reference constant containing data specified by the calling application program.</TD>
  605. </TR>
  606. </TABLE>
  607.  
  608. <BR>
  609. <B>NEW STRUCTURES FOR USE WITH THIS FUNCTION</B><BR>
  610. <BR>
  611.             <TABLE BORDER=0 CELLPADDING=1>
  612.                <TR>
  613.                   <TD bgcolor="EEEEE0">
  614.                   
  615. <PRE>
  616. OSErr CMMIterateUPP(
  617.         CMMInfo*  iterateData,       /* Ptr to a structure containing
  618.                                      /* information about a particular CMM */
  619.         void*     refcon             /* Caller-defined data, passed through from CMIterateCMMInfo 
  620. API */
  621. );
  622.  
  623. struct CMMInfo  {
  624.   unsigned long   dataSize;          /* Size of this structure - for compatibility */
  625.   OSType          CMMType;           /* Signature of CMM */
  626.   OSType          CMMMfr;            /* Vendor, e.g. 'appl */
  627.   unsigned long   CMMVersion;        /* Version number */
  628.   Handle          CMMIcons;          /* If available, can be a group with varying size 
  629. & depth */
  630.   unsigned char   ASCIIName[32];     /* Pascal string - name */
  631.   unsigned char   ASCIIDesc[256];    /* Pascal string - description or copyright */
  632.   UniCharCount    UniCodeNameCount;  /* Count of UniChars in following array */
  633.   UniChar         UniCodeName[32];   /* The name in UniCode chars */
  634.   UniCharCount    UniCodeDescCount;  /* Count of UniChars in following array */
  635.   UniChar         UniCodeDesc[256];  /* The description in UniCode chars */
  636. };
  637. </PRE>
  638. </TD>
  639. </tr>
  640. </table>
  641.  
  642. <BR>
  643. <B>DESCRIPTION</B><BR>
  644. <BR>
  645. <P>
  646. The <CODE>CMIterateCMMInfo</CODE> function returns information for all CMMs installed on the system. The caller can pass nil for the <CODE>CMMIterateUPP</CODE> param to simply get a count of CMMs.  If a <CODE>CMMIterateUPP</CODE> proc is provided, it will be called once for each CMM installed - with the <CODE>CMMInfo</CODE> structure filled accordingly.  The caller can pass a data reference to <CODE>CMIterateCMMInfo</CODE> which will then be passed to the <CODE>CMMIterateUPP</CODE>.  This might be used to allow some of the information in the <CODE>CMMInfo</CODE> data structure to be put into a menu, for example, by passing a menu reference as the refcon. Either the proc or the count parameter must be provided. The caller will get a paramErr if both are nil.
  647. </P>
  648. <BR>
  649. <TABLE width=550 border="1">
  650. <TR>
  651.     <TD>CMError</TD>    <TD><CODE>CMGetColorSyncVersion (UInt32 *version);</CODE></TD>
  652. </TR>
  653. </TABLE>
  654.  
  655. <BR>
  656. <B>Field Descriptions</B><BR>
  657. <BR>
  658. <TABLE width=550 border="1">
  659. <TR>
  660.     <TD>version</TD>    
  661.     <TD>The version of ColorSync installed on the machine is returned here</TD>
  662. </TR>
  663. </TABLE>
  664.  
  665. <BR>
  666. <B>DESCRIPTION</B><BR>
  667. <BR>
  668. <P>
  669. Returns ColorSync version information. <CODE>CMGetColorSyncVersion</CODE> relieves the Mac OS developer from having to call <CODE>Gestalt</CODE> to find out the version of ColorSync installed on the system. Since no such API exists on other platforms, ColorSync 2.6 introduced a cross-platform way of obtaining this version information.
  670. </P>
  671. <BR>
  672.  
  673. <TABLE BORDER=0 CELLPADDING=1 width=550>
  674.             <TR>
  675.                <TD bgcolor="eeeee0">
  676.                   <P><B>Important Note:</B><BR>
  677.                   The return value for ColorSync 2.6 is <CODE>0x00026000</CODE> on the Macintosh.  This is not consistent with what is currently returned by <CODE>Gestalt</CODE> (<CODE>0x00000260</CODE>).  Future versions of ColorSync on the Macintosh will be fixed so they are consistent with <CODE>Gestalt</CODE> return values.<BR>
  678.                </TD></TR>
  679.          </TABLE>
  680. <BR>
  681. <p id=p1>
  682. <a href="#top">Back to top</a>
  683. </p>
  684. <BR>
  685.  
  686. <b>Deprecated APIs</b>
  687. <BR>
  688. Support for the following APIs will be eliminated or limited in the future:<BR>
  689. <BR>
  690. <TABLE width=550 border="1">
  691.  
  692. <TR>
  693. <TH>API</TH><TH>ColorSyncVersion</TH><TH>Supported On Win</TH><TH>Supported on Mac</TH><TH>Reason for Deprecation  </TH>
  694. </TR>
  695. <TR>
  696.     <TD align=center>(CM)BeginMatching</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Pict-based, uses 1.x Profiles</TD>
  697. </TR>
  698. <TR>
  699.     <TD align=center>NCMBeginMatching</td><TD align=center>2.x</td><TD align=center>No</td><TD align=center>Yes</td> <TD align=center>Pict-based, uses 2.x Profiles</TD>
  700. </TR>
  701. <TR>
  702.     <TD align=center>(CM)EndMatching</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Pict-based</TD>
  703. </TR>
  704. <TR>
  705.     <TD align=center>(CM)EnableMatching(Comment)</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Pict-based</TD>
  706. </TR>
  707. <TR>
  708.     <TD align=center>(CM)UseProfile(Comment)</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Pict-based, uses 1.x Profiles</TD>
  709. </TR>
  710. <TR>
  711.     <TD align=center>NCMUseProfileComment</td><TD align=center>2.x</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Pict-based, uses 2.x Profiles</TD>
  712. </TR>
  713. <TR>
  714.     <TD align=center>(CM)DrawMatchedPicture</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Pict-based, uses 1.x Profiles</TD>
  715. </TR>
  716. <TR>
  717.     <TD align=center>NCMDrawMatchedPicture</td><TD align=center>2.x</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Pict-based, uses 2.x Profiles</TD>
  718. </TR>
  719. <TR>
  720.     <TD align=center>(CM)GetProfileName</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Uses 1.x Profiles</TD>
  721. </TR>
  722. <TR>
  723.     <TD align=center>(CM)GetProfileAdditionalDataOffset</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>  Uses 1.x Profiles</TD>
  724. </TR>
  725. <TR>
  726.     <TD align=center>(CM)GetProfile</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Profile Responder function</TD>
  727. </TR>
  728. <TR>
  729.     <TD align=center>(CM)SetProfile</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Profile Responder function</TD>
  730. </TR>
  731. <TR>
  732.     <TD align=center>(CM)SetProfileDescription</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Profile Responder function</TD>
  733. </TR>
  734. <TR>
  735.     <TD align=center>(CM)GetIndexedProfile</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Profile Responder function</TD>
  736. </TR>
  737. <TR>
  738.     <TD align=center>(CM)DeleteDeviceProfile</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Profile Responder function</TD>
  739. </TR>
  740. <TR>
  741.     <TD align=center>ConcatenateProfiles</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Uses 1.x Profiles</TD>
  742. </TR>
  743. <TR>
  744.     <TD align=center>CWNewColorWorld</td><TD align=center>1.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>Uses 1.x Profiles</TD>
  745. </TR>
  746. <TR>
  747.     <TD align=center>(CM)GetColorSyncFolderSpec</td><TD align=center>1.x, 2.x</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Mac-specific directory info</TD>
  748. </TR>
  749. <TR>
  750.     <TD align=center>CMSearchGetIndProfileFileSpec</td><TD align=center>2.x</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Mac-specific file data type: FSSpec</TD>
  751. </TR>
  752. <TR>
  753.     <TD align=center>CMSetSystemProfile</td><TD align=center>2.x</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Mac-specific file data type: FSSpec</TD>
  754. </TR>
  755. <TR>
  756.     <TD align=center>CMUnflattenProfile</td><TD align=center>2.x</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Mac-specific file data type: FSSpec</TD>
  757. </TR>
  758. <TR>
  759.     <TD align=center>CMGetProfileByAVID</td><TD align=center>2.5</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Mac-specific Display Manager: AVID</TD>
  760. </TR>
  761. <TR>
  762.     <TD align=center>CMSetProfileByAVI</td><TD align=center>2.5</td><TD align=center>No</td><TD align=center>Yes</td><TD align=center>Mac-specific Display Manager: AVID</TD>
  763. </TR>
  764. <TR>
  765.     <TD align=center>CWMatchPixMap</td><TD align=center>1.x, 2.x</td><TD align=center>QT?</td><TD align=center>Yes</td><TD align=center>Mac-specific data: PixMap </TD>
  766. </TR>
  767. <TR>
  768.         <TD align=center>    </td><TD align=center></TD><TD align=center>-  Supported on Win if QTML installed</TD>
  769. </TR>
  770. <TR>
  771.     <TD align=center>CWCheckPixMap</td><TD align=center>1.x, 2.x</td> <TD align=center>QT?</td><TD align=center>Yes</td><TD align=center>Mac-specific data: PixMap </TD>
  772. </TR>
  773. <TR>
  774.         <TD align=center>    </TD><TD align=center></TD><TD align=center>-  Supported on Win if QTML installed</TD>
  775. </TR>
  776. <TR>
  777.     <TD align=center>CMAccelerationLoadTables</td><TD align=center>2.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>CMM Function -  acceleration not platform independent</TD>
  778. </TR>
  779. <TR>
  780.     <TD align=center>CMAccelerationCalculateData</td><TD align=center>2.x</td><TD align=center>No</td><TD align=center>No</td><TD align=center>CMM Function -  acceleration  not platform independent</TD>
  781. </TR>
  782. </TABLE>
  783. <p id=p1>
  784. <a href="#top">Back to top</a>
  785. </p>
  786.  
  787. <BR>
  788. <A NAME="NewWindows2"></A>
  789. <H2>New ColorSync 2.6 for Windows APIs</H2>
  790. <BR>
  791. <BR>
  792.             <TABLE BORDER=0 CELLPADDING=1>
  793.                <TR>
  794.                   <TD bgcolor="EEEEE0">
  795.                   
  796. <PRE>
  797. CMError CWMatchHBITMAP (CMWorldRef             cw,
  798.                         HBITMAP                hBitmap,
  799.                         CMBitmapCallBackUPP    progressProc,
  800.                         void                  *refCon);
  801. </PRE>
  802. </TD>
  803. </tr>
  804. </table>
  805. <BR>
  806. <B>Field Descriptions</B><BR>
  807.  
  808. <TABLE width=550 border="1">
  809.  
  810. <TR>
  811.     <TD valign=top>cw</TD>    <TD valign=top>A reference to the color world in which the matching is to occur.</TD>
  812. </TR>
  813. <TR>
  814.     <TD valign=top>hBitmap</TD>    <TD valign=top>Handle of a bitmap to be matched. This is a standard Windows Win32 HBITMAP structure.</TD>
  815. </TR>
  816. <TR>
  817.     <TD valign=top>progressProc</TD>    <TD valign=top>A calling-program-supplied callback function that allows your application to monitor progress or abort the operation as the bitmap colors are matched.</TD>
  818. </TR>
  819. <TR>
  820.     <TD valign=top>refCon</TD>    <TD valign=top>A reference constant containing data specified by the calling application program.</TD>
  821. </TR>
  822. </TABLE>
  823.  
  824. <BR>
  825.  
  826. <B>DESCRIPTION</B><BR>
  827. <BR>
  828. <P>
  829. <CODE>CWMatchHBITMAP</CODE> provides the same kind of matching to platform-specific data as <CODE>CWMatchPixMap</CODE> on Mac OS.
  830. </P>
  831.  
  832. <BR>
  833.             <TABLE BORDER=0 CELLPADDING=1>
  834.                <TR>
  835.                   <TD bgcolor="EEEEE0">
  836.                   
  837. <PRE>
  838. CMError CMGetColorSyncFolderPath (Boolean        createFolder,
  839.                                   char          *lpBuffer,
  840.                                   UInt32         uSize);
  841. </PRE>
  842. </TD>
  843. </tr>
  844. </table>
  845. <BR>
  846. <B>Field Descriptions</B><BR>
  847. <BR>
  848. <TABLE width=550 border="1">
  849.  
  850. <TR>
  851.     <TD valign=top>createFolder</TD>    <TD valign=top>A Boolean specifying whether to create a new ColorSync profiles directory if one cannot be found.</TD>
  852. </TR>
  853. <TR>
  854.     <TD valign=top>lpBuffer</TD>    <TD valign=top>Contains a pointer to a buffer where you would like the ColorSync folder path returned.</TD>
  855. </TR>
  856. <TR>
  857.     <TD valign=top>uSize</TD>    <TD valign=top>Contains the size of the buffer.</TD>
  858. </TR>
  859. </TABLE>
  860.  
  861. <BR>
  862. <B>DESCRIPTION</B><BR>
  863. <BR>
  864. <P>
  865. ColorSync 2.6 now places a "ColorSync Profiles" folder directly in the System Folder for all installed profiles. Like the <CODE>CMGetColorSyncFolderSpec</CODE> function on Mac OS, <CODE>CMGetColorSyncFolderPath</CODE> gives Windows developers a way to find the location of this folder.  If the "ColorSync 
  866. Profiles" directory does not exist, the <CODE>createFolder</CODE> parameter determines whether or not it is created.
  867. </P>
  868. <BR>
  869.  
  870. <B>New CMM APIs</B><BR>
  871. <BR>
  872. <P>
  873. The following APIs specify new CMM entry points which ColorSync will call to handle the creation of new color worlds or link profiles as returned by the <CODE>NCWConcatColorWorld</CODE> and <CODE>NCWNewLinkProfile</CODE> functions respectively.  These APIs are of interest to CMM developers only.
  874. </P>
  875.  
  876. <BR>
  877. <BR>
  878.             <TABLE BORDER=0 CELLPADDING=1>
  879.                <TR>
  880.                   <TD bgcolor="EEEEE0">
  881.                   
  882. <PRE>
  883. CMError NCMMConcatInit (CMMStorageHdl              hStorage,
  884.                         NCMConcatProfileSet       *profileSet,
  885.                         CMConcatCallBackUPP        proc,
  886.                         void                      *refCon);
  887. </PRE>
  888. </TD>
  889. </tr>
  890. </table>
  891. <BR>
  892.  
  893. <B>Field Descriptions</B><BR>
  894. <BR>
  895. <BR>
  896. <TABLE width=550 border="1">
  897.  
  898. <TR>
  899.     <TD valign=top>hStorage</TD>    <TD valign=top>The CMM's private instance storage.</TD>
  900. </TR>
  901. <TR>
  902.     <TD valign=top>profileSet</TD>    <TD valign=top>Set of profiles to concatenate into a color world.</TD>
  903. </TR>
  904. <TR>
  905.     <TD valign=top>proc</TD>    <TD valign=top>Callback procedure.</TD>
  906. </TR>
  907. <TR>
  908.     <TD valign=top>refCon</TD>    <TD valign=top>User data passed on to callback procedure.</TD>
  909. </TR>
  910. </TABLE>
  911.  
  912.  
  913. <BR>
  914. <B>DESCRIPTION</B><BR>
  915. <BR>
  916. <P>
  917. This is the API which ColorSync calls when an application calls the <SAMP>NCWConcatColorWorld</SAMP> function.  The new selector for this function is <CODE>kNCMMConcatInit</CODE>.  The CMM is responsible for validating the profiles specified in the profile set 
  918. and for building a transform using these profiles.  If the CMM cannot build such a transform, it should return a <CODE>cmCantConcatenateErr</CODE> error, or another appropriate error code.
  919. </P>
  920. <BR>
  921.             <TABLE BORDER=0 CELLPADDING=1>
  922.                <TR>
  923.                   <TD bgcolor="EEEEE0">
  924.                   
  925. <PRE>
  926. CMError NCMMNewLinkProfile (CMMStorageHdl        hStorage,
  927.                             CMProfileRef         prof,
  928.                             NCMConcatProfileSet *profileSet,
  929.                             CMConcatCallBackUPP  proc,
  930.                             void                *refCon);
  931. </PRE>
  932. </TD>
  933. </tr>
  934. </table>
  935. <BR>
  936. Field Descriptions<BR>
  937. <BR>
  938. <TABLE width=550 border="1">
  939.  
  940. <TR>
  941.     <TD valign=top>hStorage</TD>    <TD valign=top>The CMM's private instance storage.</TD>
  942. </TR>
  943. <TR>
  944.     <TD valign=top>prof</TD>    <TD valign=top>The CMM will add the appropriate tags to this profile.</TD>
  945. </TR>
  946. <TR>
  947.     <TD valign=top>profileSet</TD>    <TD valign=top>Set of profiles to concatenate into a link profile.</TD>
  948. </TR>
  949. <TR>
  950.     <TD valign=top>proc</TD>    <TD valign=top>Callback procedure.</TD>
  951. </TR>
  952. <TR>
  953.     <TD valign=top>refCon</TD>    <TD valign=top>User data passed on to callback procedure.</TD>
  954. </TR>
  955. </TABLE>
  956.  
  957. <BR>
  958. <B>DESCRIPTION</B><BR>
  959. <BR>
  960. <P>
  961. This is the API which ColorSync calls when an application calls the <CODE>NCWNewLinkProfile</CODE> function.  The new selector for this function is <CODE>kNCMMNewLinkProfile</CODE>.  The CMM is responsible for validating the profiles specified in the profile set 
  962. and for building a link profile using these profiles.  If the CMM cannot build a link profile, it should return a <CODE>cmCantConcatenateErr</CODE> error, or another appropriate error code.  ColorSync will create the profile (via 
  963. <CODE>CMNewProfile</CODE>) before calling the CMM, so the CMM need only add the appropriate tags to the profile before returning.  ColorSync will also ensure that the tags are written to the profile 
  964. by calling <CODE>CMUpdateProfile</CODE>, before returning it to the caller.
  965. </P>
  966. <p id=p1>
  967. <a href="#top">Back to top</a>
  968. </p>
  969.  
  970.  
  971. <b>New ColorSync Scripting Library APIs</b>
  972. <BR>
  973. <P>
  974. ColorSync 2.6 provides a new set of scripting library APIs which are designed to give applications access to the same file format utilities provided by the new ColorSync 2.6 AppleEvent terminology. In fact, the code in ColorSync which responds to AppleEvents actually calls this same library. Listed below are the functions introduced in this new scripting library:
  975. </P>
  976.  
  977.             <TABLE BORDER=0 CELLPADDING=1>
  978.                <TR>
  979.                   <TD bgcolor="EEEEE0">
  980.                   
  981. <PRE>CMError CMValidImage (const FSSpec *spec);</PRE>
  982. </TD>
  983. </tr>
  984. </table>
  985. <BR>
  986. <B>Field Descriptions</B><BR>
  987. <BR>
  988. <TABLE width=550 border="1">
  989.  
  990. <TR>
  991.     <TD valign=top>spec</TD>    <TD valign=top>A file specification for the the image file you wish to validate.</TD>
  992. </TR>
  993. </TABLE>
  994.  
  995. <BR>
  996. <B>DESCRIPTION</B><BR>
  997. <BR>
  998. <P>
  999. This function validates the specified image file. ColorSync will check with any installed scripting plug-ins to see if they recognize the image's file format. If a scripting plug-in is found which recognizes the image's file format, <CODE>CMValidateImage</CODE> will return <CODE>noErr</CODE>. If the image's file format is not recognized, <CODE>CMValidateImage</CODE> will return the <CODE>cmInvalidImageFile</CODE> error.
  1000. </P>
  1001. <BR>
  1002.             <TABLE BORDER=0 CELLPADDING=1>
  1003.                <TR>
  1004.                   <TD bgcolor="EEEEE0">
  1005.                   
  1006. <PRE>
  1007. CMError CMGetImageSpace (const FSSpec *spec,
  1008.                                OSType *space);
  1009. </PRE>
  1010. </TD>
  1011. </tr>
  1012. </table>
  1013. <BR>
  1014. <B>Field Descriptions</B><BR>
  1015. <BR>
  1016. <TABLE width=550 border ="1">
  1017.  
  1018. <TR>
  1019.     <TD>spec</TD>    <TD>A file specification for the image file.</TD>
  1020. </TR>
  1021. <TR>
  1022.     <TD>space</TD>    <TD>The signature of the data color space of the color values of colors for the image file is returned here.</TD>
  1023. </TR>
  1024. </TABLE>
  1025.  
  1026. <BR>
  1027. <B>DESCRIPTION</B><BR>
  1028. <P>
  1029. This function returns the signature of the data color space in which the color values of colors in an image are expressed.
  1030. </P>
  1031. <BR>
  1032.             <TABLE BORDER=0 CELLPADDING=1>
  1033.                <TR>
  1034.                   <TD bgcolor="EEEEE0">
  1035.                   
  1036. <PRE>CMError CMEmbedImage (const FSSpec *specFrom,
  1037.                       const FSSpec *specInto,
  1038.                       Boolean       repl,
  1039.                       CMProfileRef  embProf);
  1040. </PRE>
  1041. </TD>
  1042. </tr>
  1043. </table>
  1044. <BR>
  1045. <B>Field Descriptions</B><BR>
  1046. <BR>
  1047. <TABLE width=550 border="1">
  1048. <TR>
  1049.     <TD valign=top>specFrom</TD>    <TD valign=top>A file specification for the image file.</TD>
  1050. </TR>
  1051. <TR>
  1052.     <TD valign=top>specInto</TD>    <TD valign=top>If this parameter is a file, it specifies the resulting image.  If this parameter is a folder, it specifies the location of the resulting image which will have the same name as the original file.  If this parameter is not provided, the original file is modified.</TD>
  1053. </TR>
  1054. <TR>
  1055.     <TD valign=top>repl</TD>    <TD valign=top>If a file with the same name already exists, it will be replaced if this parameter is set to true.</TD>
  1056. </TR>
  1057. <TR>
  1058.     <TD valign=top>embProf</TD>    <TD valign=top>The profile to embed in the image.</TD>
  1059. </TR>
  1060. </TABLE>
  1061.  
  1062. <BR>
  1063. <B>DESCRIPTION</b><BR>
  1064. <BR>
  1065. <P>
  1066. This function will embed an image with an ICC profile.
  1067. </P>
  1068. <BR>
  1069.             <TABLE BORDER=0 CELLPADDING=1>
  1070.                <TR>
  1071.                   <TD bgcolor="EEEEE0">
  1072.                   
  1073. <PRE>
  1074. CMError CMUnembedImage (const FSSpec *specFrom,
  1075.                         const FSSpec *specInto,
  1076.                         Boolean       repl);
  1077. </PRE>
  1078. </TD>
  1079. </tr>
  1080. </table>
  1081. <BR>
  1082. <B>Field Descriptions</b><BR>
  1083. <BR>
  1084. <TABLE width=550 border="1">
  1085.  
  1086. <TR>
  1087.     <TD valign=top>specFrom</TD>    <TD valign=top>A file specification for the image file.</TD>
  1088. </TR>
  1089. <TR>
  1090.     <TD valign=top>specInto</TD>    <TD valign=top>If this parameter is a file, it specifies the resulting image.  If this parameter is a folder, it specifies the location of the resulting image which will have the same name as the original file.  If this parameter is not provided, the original file is modified.</TD>
  1091. </TR>
  1092. <TR>
  1093.     <TD valign=top>repl</TD>    <TD valign=top>If a file with the same name already exists, it will be replaced if this parameter is set to true.</TD>
  1094. </TR>
  1095. </TABLE>
  1096.  
  1097. <BR>
  1098. <B>DESCRIPTION</b><BR>
  1099. <BR>
  1100. <P>
  1101. This function will remove any ICC profiles embeded in an image.
  1102. </P>
  1103. <BR>
  1104.             <TABLE BORDER=0 CELLPADDING=1>
  1105.                <TR>
  1106.                   <TD bgcolor="EEEEE0">
  1107.                   
  1108. <PRE>
  1109. CMError CMMatchImage (const FSSpec *specFrom,
  1110.                       const FSSpec *specInto,
  1111.                       Boolean       repl,
  1112.                       UInt32        qual,
  1113.                       CMProfileRef  srcProf,
  1114.                       UInt32        srcIntent,
  1115.                       CMProfileRef  dstProf);
  1116. </PRE>
  1117. </TD>
  1118. </tr>
  1119. </table>
  1120. <BR>
  1121. <B>Field Descriptions</b><BR>
  1122. <BR>
  1123. <TABLE width=550 border="1">
  1124. <TR>
  1125.     <TD>specFrom</TD>    <TD>A file specification for the image file.</TD>
  1126. </TR>
  1127. <TR>
  1128.     <TD>specInto</TD>    <TD>If this parameter is a file, it specifies the resulting image.  If this parameter is a folder, it specifies the location of the resulting image which will have the same name as the original file.  If this parameter is not provided, the original file is modified.</TD>
  1129. </TR>
  1130. <TR>
  1131.     <TD>repl</TD>    <TD>If a file with the same name already exists, it will be replaced if this parameter is set to true.</TD>
  1132. </TR>
  1133. <TR>
  1134.     <TD>qual</TD>    <TD>The optional quality for the match - normal, draft or best (<CODE>cmNormalMode</CODE>, <CODE>cmDraftMode</CODE> or <CODE>cmBestMode</CODE>).</TD>
  1135. </TR>
  1136. <TR>
  1137.     <TD>srcProf</TD>    <TD>The optional source profile for the match. </TD>
  1138. </TR>
  1139. <TR>
  1140.     <TD>srcIntent</TD>    <TD>The rendering intent for the match - perceptual intent, relative colorimetric intent, saturation intent, or absolute colorimetric intent (<CODE>cmPerceptual</CODE>, <CODE>cmRelativecolorimetric</CODE>, <CODE>cmSaturation</CODE> or <CODE>cmAbsoluteColorimetric</CODE>). </TD>
  1141. </TR>
  1142. <TR>
  1143.     <TD>dstProf</TD>    <TD>The destination profile for the match. </TD>
  1144. </TR>
  1145. </TABLE>
  1146.  
  1147. <BR>
  1148. <B>DESCRIPTION</b><BR>
  1149. <BR>
  1150. <P>
  1151. Use this function to color match an image file.
  1152. </P>
  1153. <BR>
  1154.             <TABLE BORDER=0 CELLPADDING=1>
  1155.                <TR>
  1156.                   <TD bgcolor="EEEEE0">
  1157.                   
  1158. <PRE>CMError CMProofImage (const FSSpec *specFrom,
  1159.                       const FSSpec *specInto,
  1160.                       Boolean       repl,
  1161.                       UInt32        qual,
  1162.                       CMProfileRef  srcProf,
  1163.                       UInt32        srcIntent,
  1164.                       CMProfileRef  dstProf,
  1165.                       CMProfileRef  prfProf);
  1166. </PRE>
  1167. </TD>
  1168. </tr>
  1169. </table>
  1170. <BR>
  1171. <B>Field Descriptions</b><BR>
  1172. <BR>
  1173. <TABLE width=550 border="1">
  1174.  
  1175. <TR>
  1176.     <TD>specFrom</TD>    <TD>A file specification for the image file.</TD>
  1177. </TR>
  1178. <TR>
  1179.     <TD>specInto</TD>    <TD>If this parameter is a file, it specifies the resulting image.  If this parameter is a folder, it specifies the location of the resulting image which will have the same name as the original file.  If this parameter is not provided, the original file is modified.</TD>
  1180. </TR>
  1181. <TR>
  1182.     <TD>repl</TD>    <TD>If a file with the same name already exists, it will be replaced if this parameter is set to true.</TD>
  1183. </TR>
  1184. <TR>
  1185.     <TD>qual</TD>    <TD>The optional quality for the match - normal, draft or best (<CODE>cmNormalMode, cmDraftMode</CODE> or <CODE>cmBestMode</CODE>).</TD>
  1186. </TR>
  1187. <TR>
  1188.     <TD>srcProf</TD>    <TD>The optional source profile for the match. </TD>
  1189. </TR>
  1190. <TR>
  1191.     <TD>srcIntent</TD>    <TD>The rendering intent for the match between the source and destination profiles - perceptual intent, relative colorimetric intent, saturation intent, or absolute colorimetric intent (<CODE>cmPerceptual, cmRelativecolorimetric, cmSaturation</CODE> or <CODE>cmAbsoluteColorimetric</CODE>). </TD>
  1192. </TR>
  1193. <TR>
  1194.     <TD>dstProf</TD>    <TD>The destination profile for the match. </TD>
  1195. </TR>
  1196. <TR>
  1197.     <TD>prfProf</TD>    <TD>The proof profile for the match between the destination and proof profiles. </TD>
  1198. </TR>
  1199. </TABLE>
  1200.  
  1201. <BR>
  1202. <B>DESCRIPTION</b><BR>
  1203. <BR>
  1204. Use this function to proof an image file.<BR>
  1205. <BR>
  1206.             <TABLE BORDER=0 CELLPADDING=1>
  1207.                <TR>
  1208.                   <TD bgcolor="EEEEE0">
  1209.                   
  1210. <PRE>
  1211. CMError CMLinkImage (const FSSpec *specFrom,
  1212.                      const FSSpec *specInto,
  1213.                      Boolean       repl,
  1214.                      UInt32        qual,
  1215.                      CMProfileRef  lnkProf,
  1216.                      UInt32        lnkIntent);
  1217. </PRE>
  1218. </TD>
  1219. </tr>
  1220. </table>
  1221. <BR>
  1222. <B>Field Descriptions</b><BR>
  1223. <BR>
  1224. <TABLE width=550 border="1">
  1225. <TR>
  1226.     <TD>specFrom</TD>    <TD>A file specification for the image file.</TD>
  1227. </TR>
  1228. <TR>
  1229.     <TD>specInto</TD>    <TD>If this parameter is a file, it specifies the resulting image.  If this parameter is a folder, it specifies the location of the resulting image which will have the same name as the original file.  If this parameter is not provided, the original file is modified.</TD>
  1230. </TR>
  1231. <TR>
  1232.     <TD>repl</TD>    <TD>If a file with the same name already exists, it will be replaced if this parameter is set to true.</TD>
  1233. </TR>
  1234. <TR>
  1235.     <TD>qual</TD>    <TD>The optional quality for the match - normal, draft or best (<CODE>cmNormalMode, cmDraftMode</CODE> or <CODE>cmBestMode</CODE>).</TD>
  1236. </TR>
  1237. <TR>
  1238.     <TD>lnkProf</TD>    <TD>The device link profile for the match. </TD>
  1239. </TR>
  1240. <TR>
  1241.     <TD>lnkIntent</TD>    <TD>The rendering intent for the match  - perceptual intent, relative colorimetric intent, saturation intent or absolute colorimetric intent (<CODE>cmPerceptual, cmRelativecolorimetric, cmSaturation</CODE> or <CODE>cmAbsoluteColorimetric</CODE>). </TD>
  1242. </TR>
  1243. </TABLE>
  1244.  
  1245. <BR>
  1246. <B>DESCRIPTION</b><BR>
  1247. <BR>
  1248. <P>
  1249. Use this function to match an image file with a device link profile.
  1250. </P>
  1251. <BR>
  1252.             <TABLE BORDER=0 CELLPADDING=1>
  1253.                <TR>
  1254.                   <TD bgcolor="EEEEE0">
  1255.                   
  1256. <PRE>CMError CMCountImageProfiles (const FSSpec *spec,
  1257.                               UInt32       *count);
  1258. </PRE>
  1259. </TD>
  1260. </tr>
  1261. </table>
  1262. <BR>
  1263. <B>Field Descriptions</b><BR>
  1264. <BR>
  1265.  
  1266. <TABLE width=550 border="1">
  1267. <TR>
  1268.     <TD>spec</TD>    <TD>A file specification for the image file.</TD>
  1269. </TR>
  1270. <TR>
  1271.     <TD>count</TD>    <TD>A count of the embeded profiles for the image is returned here. </TD>
  1272. </TR>
  1273. </TABLE>
  1274.  
  1275. <BR>
  1276. <B>DESCRIPTION</b><BR>
  1277. <BR>
  1278. <P>
  1279. Use this function to obtain a count of the number of embeded profiles for a given image.
  1280. </P>
  1281. <BR>
  1282.             <TABLE BORDER=0 CELLPADDING=1>
  1283.                <TR>
  1284.                   <TD bgcolor="EEEEE0">
  1285.                   
  1286. <PRE>
  1287. CMError CMGetIndImageProfile (const FSSpec *spec,
  1288.                               UInt32        index,
  1289.                               CMProfileRef *prof);
  1290. </PRE>
  1291. </TD>
  1292. </tr>
  1293. </table>
  1294. <BR>
  1295. <B>Field Descriptions</b><BR>
  1296. <BR>
  1297.  
  1298. <TABLE width=550 border="1">
  1299. <TR>
  1300.     <TD>spec</TD>    <TD>A file specification for the image file.</TD>
  1301. </TR>
  1302. <TR>
  1303.     <TD>index</TD>    <TD>The numeric index of the profile to return. </TD>
  1304. </TR>
  1305. <TR>
  1306.     <TD>prof</TD>    <TD>The profile is returned here. </TD>
  1307. </TR>
  1308. </TABLE>
  1309.  
  1310. <BR>
  1311. <B>DESCRIPTION</b><BR>
  1312. <BR>
  1313. <P>
  1314. Use this function to obtain a specific embeded profile for a given image.
  1315. </P>
  1316. <BR>
  1317.             <TABLE BORDER=0 CELLPADDING=1>
  1318.                <TR>
  1319.                   <TD bgcolor="EEEEE0">
  1320.                   
  1321. <PRE>
  1322. CMError CMSetIndImageProfile (const FSSpec *specFrom,
  1323.                               const FSSpec *specInto,
  1324.                               Boolean       repl,
  1325.                               UInt32        index,
  1326.                               CMProfileRef  prof);
  1327. </PRE>
  1328. </TD>
  1329. </tr>
  1330. </table>
  1331.  
  1332. <BR>
  1333. <B>Field Descriptions</b><BR>
  1334. <BR>
  1335.  
  1336. <TABLE width=550 border="1">
  1337. <TR>
  1338.     <TD>specFrom</TD>    <TD>A file specification for the image file.</TD>
  1339. </TR>
  1340. <TR>
  1341.     <TD>specInto</TD>    <TD>If this parameter is a file, it specifies the resulting image.  If this parameter is a folder, it specifies the location of the resulting image which will have the same name as the original file. If this parameter is not provided, the original file is modified.</TD>
  1342. </TR>
  1343. <TR>
  1344.     <TD>repl</TD>    <TD>If a file with the same name already exists, it will be replaced if this parameter is set to true.</TD>
  1345. </TR>
  1346. <TR>
  1347.     <TD>index</TD>    <TD>The numeric index of the profile to set. </TD>
  1348. </TR>
  1349. <TR>
  1350.     <TD>prof</TD>    <TD>The profile to set at the index designated by the index parameter. </TD>
  1351. </TR>
  1352. </TABLE>
  1353.  
  1354. <BR>
  1355. <B>DESCRIPTION</b><BR>
  1356. <BR>
  1357. <P>
  1358. Use this function to set a specific embeded profile for a given image.
  1359. </P>
  1360. <BR>
  1361. <B>New CMBitmap Types</B><BR>
  1362. <BR>
  1363. <P>
  1364. Several new <CODE>CMBitmap</CODE> spaces were added in ColorSync 2.6 (see below) to provide developers with a wide range of data formats appropriate for multiple platforms.  Both the Mac and Windows 
  1365. versions of ColorSync 2.6 support all these bitmap formats.
  1366. </P>
  1367.  
  1368. <P>
  1369. Several bitmap spaces now can have a new space attribute flag <CODE>cmLittleEndianPacking</CODE> set to indicate Little-Endian data. Another new variant <CODE>cmReverseChannelPacking</CODE>, which can apply to just about all of the new and old spaces is a "reverse channels" attribute.
  1370. </P>
  1371. <BR>
  1372. <B>Bitmap spaces supported in ColorSync 2.5</B><BR>
  1373. <BR>
  1374. <UL TYPE=DISC>
  1375.     <LI>cmGray16Space = cmGraySpace,
  1376.     <LI>cmGrayA32Space = cmGrayASpace,
  1377.     <LI>cmRGB16Space = cmWord5ColorPacking + cmRGBSpace,
  1378.     <LI>cmRGB24Space = cm24_8ColorPacking + cmRGBSpace,
  1379.     <LI>cmRGB32Space = cm32_8ColorPacking + cmRGBSpace,
  1380.     <LI>cmRGB48Space = cm48_16ColorPacking + cmRGBSpace,
  1381.     <LI>cmARGB32Space = cm32_8ColorPacking + cmAlphaFirstPacking + cmRGBASpace,
  1382.     <LI>cmRGBA32Space = cm32_8ColorPacking + cmAlphaLastPacking + cmRGBASpace,
  1383.     <LI>cmCMYK32Space = cm32_8ColorPacking + cmCMYKSpace,
  1384.     <LI>cmCMYK64Space = cm64_16ColorPacking + cmCMYKSpace,
  1385.     <LI>cmHSV32Space = cmLong10ColorPacking + cmHSVSpace,
  1386.     <LI>cmHLS32Space = cmLong10ColorPacking + cmHLSSpace,
  1387.     <LI>cmYXY32Space = cmLong10ColorPacking + cmYXYSpace,
  1388.     <LI>cmXYZ32Space = cmLong10ColorPacking + cmXYZSpace,
  1389.     <LI>cmLUV32Space = cmLong10ColorPacking + cmLUVSpace,
  1390.     <LI>cmLAB24Space = cm24_8ColorPacking + cmLABSpace,
  1391.     <LI>cmLAB32Space = cmLong10ColorPacking + cmLABSpace,
  1392.     <LI>cmLAB48Space = cm48_16ColorPacking + cmLABSpace,
  1393.     <LI>cmGamutResult1Space = cmOneBitDirectPacking + cmGamutResultSpace,
  1394.     <LI>cmNamedIndexed32Space = cm32_32ColorPacking + cmNamedIndexedSpace,
  1395.     <LI>cmMCFive8Space = cm40_8ColorPacking + cmMCFiveSpace,
  1396.     <LI>cmMCSix8Space = cm48_8ColorPacking + cmMCSixSpace,
  1397.     <LI>cmMCSeven8Space = cm56_8ColorPacking + cmMCSevenSpace,
  1398.     <LI>cmMCEight8Space = cm64_8ColorPacking + cmMCEightSpace
  1399. </UL>
  1400.  
  1401. <BR>
  1402. <B>New Spaces added for 2.6</B><BR>
  1403. <BR>
  1404. <UL TYPE=DISC>
  1405.     <LI>cmGray8Space = cmGraySpace + cm8_8ColorPacking,  8-bit gray
  1406.     <LI>cmGrayA16Space = cmGrayASpace + cm16_8ColorPacking, 8-bit gray + 8-bit alpha
  1407.     <LI>cmGray16LSpace = cmGraySpace + cmLittleEndianPacking, 16-bit gray, little-endian
  1408.     <LI>cmGrayA32LSpace = cmGrayASpace + cmLittleEndianPacking, 16-bit gray + 16-bit alpha, little-endian
  1409.     <LI>cmRGB565Space = cmRGBSpace + cmWord565ColorPacking, Variant of 1.5.5.5
  1410.     <LI>cmRGB565LSpace = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking, Variant of 1.5.5.5, little-endian
  1411.     <LI>cmRGB16LSpace = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking, 1.5.5.5, little-endian
  1412.     <LI>cmRGB48LSpace = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking, 16-bits per channel RGB, little-endian
  1413.     <LI>cmARGB64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking, 16-bits per channel RGB w/leading alpha channel
  1414.     <LI>cmARGB64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking, bits / chl RGB w/leading alpha, little-endian
  1415.     <LI>cmRGBA64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking, 16-bits / chl RGB with trailing alpha channel
  1416.     <LI>cmRGBA64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking bits / chl RGB w/trailing alpha, little-endian
  1417.     <LI>cmCMYK64LSpace = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking, 16-bits per channel CMYK, little-endian
  1418.     <LI>cmXYZ24Space = cmXYZSpace + cm24_8ColorPacking,  8-bit per channel XYZ
  1419.     <LI>cmXYZ48Space = cmXYZSpace + cm48_16ColorPacking, 16-bits per channel XYZ
  1420.     <LI>cmXYZ48LSpace = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking, 16-bits 
  1421.     <LI>per channel XYZ, little-endian
  1422.     <LI>cmLAB48LSpace = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking, 16-bits per channel Lab, little-endian
  1423.     <LI>cmNamedIndexed32LSpace = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking, 32-bit index, little-endian
  1424. </UL>
  1425.  
  1426. <BR>
  1427. <B>ICC Profile Description (<CODE>'desc'</CODE>) Tag Handling</B><BR>
  1428. <BR>
  1429. <P>
  1430. One important change in the recent release of ColorSync (version 2.6) is how it handles the description (<CODE>'desc'</CODE>) tag of ICC profiles.
  1431. </P>
  1432. <P>
  1433. The <CODE>'desc'</CODE> tag of a profile, as defined by the ICC, contains up to three strings. The first is a required 7-bit Roman ASCII string.  The second is an optional localized Unicode string.  The third, also optional, is a localized string in Mac script-code format.  Applications typically use one of the available strings to show the name of profiles in a list or pop-up menu.  There are a few other important devilish details in the ICC definition of the <CODE>'desc'</CODE> tag.  One is that all three strings must be null terminated.  Another is that all three strings are preceded by a character count that includes the null terminator.  It is also worth noting that for the Unicode string, the character count must not be confused with a byte count because each Unicode character requires two bytes.
  1434. </P>
  1435.  
  1436. <P>
  1437. Previous releases of ColorSync only make partial use of this tag and, as a result, only performed limited error checking on its contents.  For example, The ColorSync function <CODE>CMGetScriptProfileDescription</CODE> would return the Mac script-code from a profile if it was present and, if not, it would return the 7-bit Roman ASCII string.  The Unicode string was simply ignored and in some cases, if the Unicode and/or Mac script-code string were non-compliant, ColorSync would return garbage (or the ASCII string if you were lucky) without returning <CODE>cmProfileErr</CODE> code.
  1438. </P>
  1439.  
  1440. <P>
  1441. ColorSync 2.6 is the first release of the technology that was designed to run both on Mac OS and Windows.  Since Mac script-code format strings are not usable on Windows, ColorSync clients need to have access to the localized Unicode string. (Unicode strings are also becoming more usable on Macs.)  For this reason a new call, <CODE>CMGetProfileDescriptions</CODE>, was added to access all three possible strings.  In doing so much stricter attention 
  1442. had to be paid to the compliance of the <CODE>'desc'</CODE> tag.  For example, if either the ASCII string or the Mac script-code strings is not null terminated, or if any of the string's character counts are invalid or beyond the range of the <CODE>'desc'</CODE> tag, the and <CODE>cmProfileErr</CODE> code is returned.
  1443. </P>
  1444.  
  1445. <P>
  1446. In order to achieve optimal performance when applications add profiles to a list or pop-up menu, ColorSync maintains a cache of all the profiles installed in the "ColorSync Profiles" folder and its sub-directories.  Among other things this cache file contains the three possible names of each profile obtained by calling <CODE>CMGetProfileDescriptions</CODE>.  If <CODE>CMGetProfileDescriptions</CODE> returns an error because the <CODE>'desc'</CODE> tag is non-compliant, then the profile is not added to the cache.  This is why non-compliant profiles, even though they are properly installed in the "ColorSync Profiles" folder, no longer show up in the ColorSync control panel or the ColorSync plug-ins pop-up menus with ColorSync 2.6 installed.
  1447. </P>
  1448.  
  1449. <P>
  1450. The remedy for this problem is to repair the affected profiles. Unfortunately, the "Rename Profile" AppleScript that is installed as part of ColorSync 2.6 can not be used to repair profiles with bad <CODE>'desc'</CODE> tags because it can only operate on profiles in the ColorSync profile cache. Instead, a simple stand-alone tool called "Profile First Aid" to verify and repair any profile will be made available on the the ColorSync web site <<A HREF="http://www.apple.com/colorsync">http://www.apple.com/colorsync</A>>.
  1451. </P><BR>
  1452. <p id=p1>
  1453. <a href="#top">Back to top</a>
  1454. </p>
  1455.  
  1456. <A NAME="Compatibility"></A>
  1457. <H2>ColorSync 2.6 for Macintosh Compatibility Issues</H2><BR>
  1458.  
  1459. <B>ColorSync 1.X/2.X Support</B><BR>
  1460.  
  1461. <P>
  1462. Support for version 1.0 profiles and hybrid (1.0/2.0) color worlds has been removed in ColorSync 2.6 for Macintosh. ColorSync 1.0 profiles, APIs and CMMs are not supported.
  1463. </P>
  1464.  
  1465. <B>CMM</B><BR>
  1466. <P>
  1467. No longer required to support ColorSync 1.0 Profiles. Existing CMMs will be compatible.
  1468. </P>
  1469. <P>
  1470. New CMM APIs: <CODE>NCMConcatInit</CODE>, <CODE>NCMMNewLinkProfile</CODE> (see section "<A HREF="#NewAPIs">New CMM APIs</A>" for the details) which a CMM may choose to implement. If a given CMM does not implement these new APIs, the default CMM is invoked instead. 
  1471. </P>
  1472.  
  1473. <B>Profile Searching</B><BR>
  1474.  
  1475. <P>
  1476. ColorSync 2.6 will support new profile locations (System Folder) for Profile searches made with the search functions (<CODE>CMNewProfileSearch</CODE>, etc.). Profiles in subfolders within the profiles folder will be found as well.
  1477. </P>
  1478. <BR>
  1479. <B>Color Worlds</B><BR>
  1480. <P>
  1481. New API <CODE>NCWConcatColorWorld</CODE> (see section "<A HREF="#NewAPIs">New ColorSync 2.6 APIs</A>" for the details) puts power and responsibility of color world design into the hands of developers.  Callers can select which profile 
  1482. tags and rendering intents to use. It also allows for new combinations of profiles which were previously not supported (e.g., more than one device-link profile).
  1483. </P>
  1484. <BR>
  1485. <B>QuickDraw Matching</B><BR>
  1486. <BR>
  1487. 2.X QuickDraw calls will continue to be supported (<CODE>N/NCMBeginMatching</CODE>, <CODE>CMEndMatching</CODE>, <CODE>N/CMDrawMatchedPicture</CODE>, <CODE>CWMatchPixMap</CODE>, <CODE>CWCheckPixMap</CODE>).<BR>
  1488. <BR>
  1489. <B>Scripting & File Formats</B><BR>
  1490. <BR>
  1491. JPEG, GIF as well as TIFF file format plug-ins are now supported.<BR>
  1492. <BR>
  1493. <B>Endian Issues</B>
  1494. <P>
  1495. If an API returns data in a structure, the data will be in the proper endian-ness for the platform i.e., Big-Endian on the Mac, Little-Endian under Windows. For example, the <CODE>CMGetCWInfo</CODE> function returns data in a <CODE>CMCWInfoRecord</CODE> structure. If this function is called on a Macintosh, the data in the structure would 
  1496. be returned in Big-Endian format.
  1497. </P>
  1498.  
  1499. <P>
  1500. If data is passed to or returned by an API as simply a stream of bytes, the data is assumed to be in Big-Endian format. It is the caller's responsibility to convert from native Endian to Big-Endian format.
  1501. </P>
  1502. <BR><p id=p1>
  1503. <a href="#top">Back to top</a>
  1504. </p>
  1505.  
  1506. <A NAME="WinCompatibility"></A>
  1507. <H2>ColorSync 2.6 for Windows Compatibility Issues</H2>
  1508. <BR>
  1509. <B>CMM</B><BR>
  1510. <BR>
  1511. CMMs need only support the following entry points:<BR>
  1512. <BR>
  1513. <CODE>CMMatchBitmap, CMMCheckBitmap, CMMConcatInit, CMMCheckColors, CMMClose, CMMGetCMMInfo, CMMMatchColors, CMMOpen, NCMMInit</CODE>
  1514. <BR>
  1515. <P>
  1516. <B>New CMM APIs:</B><BR>
  1517.  <CODE>NCMConcatInit</CODE>, <CODE>NCMMNewLinkProfile</CODE> (see section "<A HREF="#NewAPIs">New CMM APIs</A>" for the details) which a CMM may choose to implement. If a given CMM does not implement these new APIs, the default CMM is invoked instead.
  1518. </P>
  1519. <BR>
  1520. <B>ColorSync 1.X/2.X Support</B><BR>
  1521. <BR>
  1522. Applications writing to the 2.X APIs will require minimal changes to work.<BR>
  1523. ColorSync 1.0 Profiles, APIs and CMMs are not supported.<BR>
  1524. <BR>
  1525. <B>Profile Access</B><BR>
  1526. <P>
  1527. ColorSync 2.6 places a "ColorSync Profiles" folder directly in the System Folder. A new location type <CODE>CMPathLocation</CODE> (see "New <CODE>CMProfileLocation</CODE> Types" below) describing the Windows file system specification for this folder has been added to the <CODE>CMProfileLocation</CODE> structure.
  1528. </P>
  1529. <BR>
  1530. <B>New CMProfileLocation Types</B><BR>
  1531. <BR>
  1532. <CODE>CMProfileLocation</CODE> Expanded - new location types have been added to the <CODE>CMProfileLocation</CODE> structure to give developers a way to specify profiles on Windows systems.<BR>
  1533. <BR>
  1534. Current Location types:<BR>
  1535. <BR>
  1536.             <TABLE BORDER=0 CELLPADDING=1>
  1537.                <TR>
  1538.                   <TD bgcolor="EEEEE0">
  1539.                   
  1540. <PRE>
  1541.         CMFileLocation
  1542.         CMHandleLocation
  1543.         CMPtrLocation
  1544.         CMProcedureLocation
  1545. </PRE>
  1546. </TD>
  1547. </tr>
  1548. </table>        
  1549. <BR>
  1550. New Location types:<BR>
  1551. <BR>
  1552.             <TABLE BORDER=0 CELLPADDING=1>
  1553.                <TR>
  1554.                   <TD bgcolor="EEEEE0">
  1555.                   
  1556. <PRE>       
  1557.     CMPathLocation     (specify path as string of chars)
  1558.     CMBufferLocation   (contains ptr and size) 
  1559. </PRE>
  1560. </TD>
  1561. </tr>
  1562. </table>
  1563. <BR>
  1564.  
  1565. <TABLE BORDER=0 CELLPADDING=1>
  1566.     <TR>
  1567.     <TD bgcolor="EEEEE0">
  1568.                   
  1569. <PRE>
  1570. #define CS_MAX_PATH     256     // How many chars allowed in path name
  1571.  
  1572. struct CMPathLocation {
  1573.         char    path[CS_MAX_PATH];      // A complete path
  1574. };
  1575.  
  1576. struct CMBufferLocation {
  1577.         void *  buffer; // Ptr to profile data
  1578.         UInt32  size;   // Size of Ptr
  1579. };
  1580.  
  1581. union CMProfLoc {
  1582.         CMFileLocation        fileLoc;
  1583.         CMHandleLocation      handleLoc;
  1584.         CMPtrLocation         ptrLoc;
  1585.         CMProcedureLocation   procLoc;
  1586.         CMPathLocation        pathLoc;
  1587.         CMBufferLocation      bufferLoc;
  1588. };
  1589.  
  1590. enum {
  1591.         cmNoProfileBase         = 0,
  1592.         cmFileBasedProfile      = 1,
  1593.         cmHandleBasedProfile    = 2,
  1594.         cmPtrBasedProfile       = 3,
  1595.         cmProcedureBasedProfile = 4,
  1596.         cmPathBasedProfile      = 5,
  1597.         cmBufferBasedProfile    = 6
  1598. };
  1599. </PRE>
  1600. </TD>
  1601. </tr>
  1602. </table>
  1603.  
  1604. <BR>
  1605. <B>Profile Searching</B><BR>
  1606. <BR>
  1607. <P>
  1608. ColorSync 2.6 for Windows supports standard locations (System Folder) for Profile searches.
  1609. </P>
  1610. <BR>
  1611. <B>QuickDraw Matching</B><BR>
  1612. <BR>
  1613. ColorSync 2.6 for Windows does not support the following APIs:<BR>
  1614. <BR>
  1615. <P>
  1616. <CODE>N/NCMBeginMatching, CMEndMatching, N/CMDrawMatchedPicture, CWMatchPixMap, CWCheckPixMap.</CODE>
  1617. </P>
  1618. <BR>
  1619. PixMaps can easily be matched via the <CODE>CMBitMap</CODE> routines.<BR>
  1620. <BR>
  1621. <B>Win32 Matching</B><BR>
  1622. <BR>
  1623. <P>
  1624. New API <CODE>CWMatchHBITMAP</CODE> (see section "<A HREF="#NewAPIs">New ColorSync 2.6 APIs</A>" above) supports direct matching/checking of Windows <CODE>HBitMap</CODE> structure.
  1625. </P>
  1626.  
  1627. <BR>
  1628. <B>Endian Issues</B><BR>
  1629. <BR>
  1630. <P>
  1631. If an API returns data in a structure, the data will be in the proper endian-ness for the platform i.e., Big-Endian on the Mac, Little-Endian under Windows.  For example, the <CODE>CMGetCWInfo</CODE> function returns data in a <CODE>CMCWInfoRecord</CODE> structure. If this function is called on a Windows machine, the data in the structure 
  1632. would be returned in Little-Endian format.
  1633. </P>
  1634. <P>
  1635. If data is passed to or returned by an API as simply a stream of bytes, the data is assumed to be in Big-Endian format. It is the caller's responsibility to convert from native Endian to Big-Endian format.
  1636. </P></TD>
  1637. </TR>
  1638. </TABLE>
  1639. <p id=p1>
  1640. <a href="#top">Back to top</a>
  1641. </p>
  1642.  
  1643. <A NAME="References"></A><BR>
  1644. <H3>Further References</H3>
  1645.  
  1646. <P><TABLE BORDER=0 CELLPADDING=1 WIDTH=498>
  1647.    <TR>
  1648.       <TD bgcolor="eeeee0">
  1649.          <UL>
  1650.             <LI><A HREF="/macos/color.html">Inside Macintosh:Managing Color With ColorSync.</A>
  1651.          </UL>
  1652.       </TD></TR>
  1653. </TABLE><BR>
  1654.  
  1655. <p id=p1>
  1656. <a href="#top">Back to top</a>
  1657. </p>
  1658.  
  1659. <H3>Change History</H3>
  1660.  
  1661. <P><TABLE BORDER=0 WIDTH=498>
  1662.    <TR>
  1663.       <TD bgcolor="eeeee0">
  1664.          <UL>
  1665.             <LI>Originally written in April 1999 by Scott Kuechle.
  1666.             
  1667.             <LI>Corrected the NCMConcatProfileSet structure
  1668.             definition. 4/26/99
  1669.          </UL>
  1670.       </TD></TR>
  1671. </TABLE><BR>
  1672.  
  1673. </P>
  1674. <A NAME="Downloads"></A></P>
  1675.  
  1676. <H3>Downloadables</H3>
  1677.  
  1678. <P><TABLE BORDER=0 CELLPADDING=1 width=550 bgcolor="#eeeee0">
  1679.    <TR>
  1680.       <TD>
  1681.          <P><!-- Get correct doc name --><A HREF="pdf/tn1160.pdf">
  1682.          <IMG SRC="images/acrobatsmall.gif" WIDTH=22 HEIGHT=23 ALIGN=bottom>
  1683.          Acrobat version of this Note (98K).</A><BR>
  1684.          </TD></TR>
  1685. </TABLE><BR>
  1686.  
  1687. </P>
  1688.  
  1689. <p id=p1>
  1690. <a href="#top">Back to top</a>
  1691. </p>
  1692.  
  1693. <H3>Acknowledgments</H3>
  1694.  
  1695. <P>Thanks to Eric Broadbent, David Hayward, John Myer, Steve Evangelou, Hans-Werner Neubrand, and John Gnaegy.</P>
  1696.  
  1697. <P><hr size="1" noshade color="#000000" width="550" align="left"></P>
  1698.  
  1699. <H4>To contact us, please use the <a href="/contact/index.html">Contact Us</a> page.<BR>
  1700.  
  1701. Updated: 26-April-99</H4>
  1702. <BR>
  1703. <A HREF="/technotes/index.html">Technotes</A> | <A HREF="tn-3.html">Contents</A><br>
  1704. <A HREF="tn1159.html">Previous Technote</A> | <A HREF="tn1161.html">Next Technote</A> <BR>
  1705.  
  1706.  
  1707.  
  1708. <!--------------------------- Navigation Area ---------------------------------->
  1709. <!-- start of footer -->
  1710. <!--#include file="footer" -->
  1711. <!-- -->
  1712. <!-- end of footer -->
  1713.  
  1714. </BODY>
  1715. </HTML>
  1716.